import request from '@/utils/request'

// 查询生产工单列表
export function listWorkorder(query) {
  return request({
    url: '/pm/workorder/list',
    method: 'get',
    params: query
  })
}

// 查询生产工单详细
export function getWorkorder(orderId) {
  return request({
    url: '/pm/workorder/' + orderId,
    method: 'get'
  })
}

// 新增生产工单
export function addWorkorder(data) {
  return request({
    url: '/pm/workorder',
    method: 'post',
    data: data
  })
}

// 修改生产工单
export function updateWorkorder(data) {
  return request({
    url: '/pm/workorder',
    method: 'put',
    data: data
  })
}

// 删除生产工单
export function delWorkorder(orderId) {
  return request({
    url: '/pm/workorder/' + orderId,
    method: 'delete'
  })
}
// 产品不分页
export function listProduct(query) {
  return request({
    url: '/pm/plan/product/getlist',
    method: 'get',
    params: query
  })
}

// 生产线不分页
export function listLine(query) {
  return request({
    url: '/pm/plan/line/getlist',
    method: 'get',
    params: query
  })
}


// 关联计划不分页
export function listPlan(query) {
  return request({
    url: '/pm/workorder/plan/getlist',
    method: 'get',
    params: query
  })
}

